<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateArticlesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('articles', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('category_id'); // 文章分类 ID
            $table->integer('admin_id'); //发布文章的后台用户
            $table->tinyInteger('sort')->default(0); // 排序
            $table->string('cover')->nullable();
            $table->string('title');
            $table->string('href')->default('');
            $table->boolean('display')->default(true);
            $table->mediumText('content');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('articles');
    }
}
